import Vue from 'vue'
import VueRouter from 'vue-router'
//导入组件
import Login from '../views/login.vue'
import Index from '../views/index.vue'


//安装路由
Vue.use(VueRouter)



//配置导出路由
export default new VueRouter({
	 mode: 'history',
	routes: [
		// 动态路径参数 以冒号开头// path: '/user/:id',
		{
			//路径
			path: '/login',
			//起名字
			name: 'Login',
			//组件
			component: Login
		},
		{
			//路径
			path: '/',
			//起名字
			name: 'Index',
			//组件
			component: Index,
			children:[
				{path: '/index/menu1',component: () => import('../views/biz/main1.vue')},
				{path: '/index/menu2',component: () => import('../views/biz/main2.vue')},
				{path: '/index/menu3',component: () => import('../views/biz/main3.vue')},
				{path: '/index/goodsManage',component: () => import('../views/biz/goodsManage.vue')}
			]

		},
	]
})
